package com.learn.design.abstractfactory.service;

import com.learn.design.abstractfactory.action.RedisUtils;

import java.util.concurrent.TimeUnit;

/**
 * @author xuhainan
 * @date 2023/8/1 16:51
 * @region hefei
 */
public class CacheServiceImpl implements ICacheService {
    private final RedisUtils redisUtils = new RedisUtils();

    @Override
    public String get(String key) {
        return redisUtils.get(key);
    }

    @Override
    public void set(String key, String value) {
        redisUtils.set(key, value);
    }

    @Override
    public void set(String key, String value, long timeout, TimeUnit timeUnit) {
        redisUtils.set(key, value, timeout, timeUnit);
    }

    @Override
    public void del(String key) {
        redisUtils.delete(key);
    }
}
